
/*
 * PrincipalView.java
 *
 * Created on 24-abr-2012, 15:24:54
 */
package educar.gui;

import educar.controllers.PrincipalController;
import javax.swing.JButton;
import javax.swing.JFrame;

/**
 *
 * @author Flubber
 */
public class PrincipalView extends javax.swing.JFrame {

// <editor-fold defaultstate="collapsed" desc="Constructor">    
    /** Creates new form PrincipalView */
    public PrincipalView() {
        initComponents();
    }
// </editor-fold>

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jbUsuario = new javax.swing.JButton();
        jbAlumno = new javax.swing.JButton();
        jbDocente = new javax.swing.JButton();
        jbFacultad = new javax.swing.JButton();
        jbCargo = new javax.swing.JButton();
        jbMateria = new javax.swing.JButton();
        jbDedicacion = new javax.swing.JButton();
        jbAsignacion = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setResizable(false);

        jbUsuario.setFont(new java.awt.Font("Tahoma", 1, 12));
        jbUsuario.setText("Usuario");

        jbAlumno.setFont(new java.awt.Font("Tahoma", 1, 12));
        jbAlumno.setText("Alumno");

        jbDocente.setFont(new java.awt.Font("Tahoma", 1, 12));
        jbDocente.setText("Docente");

        jbFacultad.setFont(new java.awt.Font("Tahoma", 1, 12));
        jbFacultad.setText("Facultad");

        jbCargo.setFont(new java.awt.Font("Tahoma", 1, 12));
        jbCargo.setText("Cargo");

        jbMateria.setFont(new java.awt.Font("Tahoma", 1, 12));
        jbMateria.setText("Materia");

        jbDedicacion.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jbDedicacion.setText("Dedicacion");

        jbAsignacion.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jbAsignacion.setText("Asignacion");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jbCargo, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbDocente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbUsuario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jbMateria, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbFacultad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbAlumno, javax.swing.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jbDedicacion, javax.swing.GroupLayout.DEFAULT_SIZE, 100, Short.MAX_VALUE)
                    .addComponent(jbAsignacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jbAlumno, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbUsuario, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jbDedicacion, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbFacultad, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbDocente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jbMateria, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jbCargo, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE)
                    .addComponent(jbAsignacion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

// <editor-fold defaultstate="collapsed" desc="Declaracion de Variables"> 
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jbAlumno;
    private javax.swing.JButton jbAsignacion;
    private javax.swing.JButton jbCargo;
    private javax.swing.JButton jbDedicacion;
    private javax.swing.JButton jbDocente;
    private javax.swing.JButton jbFacultad;
    private javax.swing.JButton jbMateria;
    private javax.swing.JButton jbUsuario;
    // End of variables declaration//GEN-END:variables
// </editor-fold>

    public JButton getJbAlumno() {
        return jbAlumno;
    }

    public JButton getJbCargo() {
        return jbCargo;
    }

    public JButton getJbDocente() {
        return jbDocente;
    }
    
    public JButton getJbFacultad() {
        return jbFacultad;
    }

    public JButton getJbMateria() {
        return jbMateria;
    }

    public JButton getJbUsuario() {
        return jbUsuario;
    }

    public JButton getJbDedicacion() {
        return jbDedicacion;
    }
     public JButton getJbAsignacion() {
        return jbAsignacion;
    }
    
    
    
    /**
     * Ventana
     * @return PrincipalView
     */
    public JFrame getVentana(){
        return this;
    }

    
    /**
     * Asigna un Listener a los Botones
     * @param listener
     */
    public void setListenerButton(PrincipalController listener) {
        jbAlumno.addActionListener(listener);
        jbCargo.addActionListener(listener);
        jbDocente.addActionListener(listener);
        jbFacultad.addActionListener(listener);
        jbMateria.addActionListener(listener);
        jbUsuario.addActionListener(listener);
        jbDedicacion.addActionListener(listener);
        jbAsignacion.addActionListener(listener);
    }
    
    
    /**
     * Asigna un Listener a la Ventana
     * @param listener
     */
    public void setListenerWindow(PrincipalController listener){
        this.addWindowListener(listener);
    }
}
